import { usePayOderStore } from '@/stores/payOder'
import type { ICart, IOderNum } from '@/types/types'
import { useRouter } from 'vue-router'
import {ref ,type Ref,onMounted} from 'vue'
import { useCartStore } from '@/stores/cart'

export const usePayOder = () => {
    const payOderStore = usePayOderStore()
    const router = useRouter()
    const oderList:Ref<Array<IOderNum>>=ref([])
    const cartStore = useCartStore()
    const checkGoodsList:Ref<Array<ICart>>=ref([])
    
    
        
    // }
    // 存储选中的数据
    checkGoodsList.value = cartStore.checkGoods
    payOderStore.saveCheckGoodsList(checkGoodsList.value)
    
    

    // 跳转到支付界面
    const bindGoPay =()=>{
        router.push({path:'/goPay'})
    }


    return{ payOderStore,checkGoodsList,bindGoPay,oderList}
}
